package com.yida.gwj.config.controller;

import com.yida.common.core.web.controller.BaseController;
import com.yida.common.core.web.domain.AjaxResult;
import com.yida.common.core.web.page.TableDataInfo;
import com.yida.gwj.common.utils.GwjConvertUtil;
import com.yida.gwj.config.domain.dto.GwjBusinessLogDTO;
import com.yida.gwj.config.domain.request.GwjConfigFlowBusinessRequest;
import com.yida.gwj.config.service.IGwjBusinessCommonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @Author: PPV
 * @Date: 2023-02-24
 */
@RestController
@RequestMapping("/business")
@Api(tags = "公维金业务共用")
public class GwjBusinessCommonController extends BaseController {
    @Resource
    private IGwjBusinessCommonService gwjBusinessCommonService;

    @PostMapping("/flow")
    @ApiOperation("查看业务流程")
    public AjaxResult getByBizId(@Validated @RequestBody GwjConfigFlowBusinessRequest request) {
        return AjaxResult.success(gwjBusinessCommonService.getByBizId(request));
    }

    @GetMapping("/log")
    @ApiOperation("查看业务日志")
    public TableDataInfo log(Long bizId, String dictLabel, Integer outSideFlag) {
        return gwjBusinessCommonService.getLogTable(bizId, dictLabel, outSideFlag);
    }

}
